﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DoAnWeb.DAO;
using DoAnWeb.DTO;
using DoAnWeb.BUS;

namespace DoAnWeb.Admin
{
    public partial class ProductDetails : System.Web.UI.Page
    {
        TinKhuyenMaiBUS BUS = new TinKhuyenMaiBUS();
        TinKhuyenMaiDTO DTO = new TinKhuyenMaiDTO();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["proID"] == null)
                    Response.Redirect("~/Product.aspx");

                int proID = int.Parse(Request.QueryString["proID"].ToString());
                DTO = BUS.GetFromId(proID);


                imgHinhAnh.ImageUrl = "~/images/Cat/" + DTO.HinhAnh;
                lbTenSanPham.Text = DTO.TieuDe;
                lbLoai.Text = DTO.TenLoaiSanPham;
                lbGia.Text = string.Format("{0:#,#.##}", DTO.GiaBan) + " VNĐ";
                txtMoTa.Text = DTO.MoTa;
            }
        }
    }
}